package org.sunnyleaf.votedemo.client.data;

import java.io.Serializable;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@SuppressWarnings("serial")
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class VoteRecord implements Serializable{
	
	/**
	 * GWT needs all it's serializable classes to have a default empty constructor. That's all.
	 * Shit!!
	 */
	public VoteRecord(){
		
	}
	
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long id;

	@Persistent
	private String account;
	
	@Persistent
	private Long voteId;
	
	@Persistent
	private Boolean isVoted;

	public VoteRecord( String account, Long voteId){
		this.account = account;
		this.voteId = voteId;
		this.isVoted = false;
	}
	
	/**
	 * @return the account
	 */
	public String getAccount() {
		return account;
	}

	/**
	 * @return the voteID
	 */
	public Long getVoteId() {
		return voteId;
	}

	/**
	 * @param voteID the voteID to set
	 */
	public void setVoteId(Long voteID) {
		this.voteId = voteID;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param account the account to set
	 */
	public void setAccount(String account) {
		this.account = account;
	}

	/**
	 * @return the isVoted
	 */
	public Boolean isVoted() {
		return isVoted;
	}

	/**
	 * @param isVoted the isVoted to set
	 */
	public void setVoted(Boolean isVoted) {
		this.isVoted = isVoted;
	}

	
	
}
